home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 05.zip
/
BS1 part 5
/
PDraw3.0.adf
/
pdraw_rex.lzh
/
SpacePoints.pdrx
< prev
next >
Wrap
Text File
|
1992-06-17
|
2KB
|
73 lines
/*
@N
This Genie will position two points in a bezier object at a precise distance apart.
*/
counter = 0
cr = '0a'x
msg = PDSetup.rexx(2,0)
units = getclip(pds_units)
if msg ~= 1 then exit_msg(msg)
point1 = pdm_ClickOnPoint("Click on first point in object..")
if point1 = '0 0' then exit_msg()
point2 = pdm_ClickOnPoint("Click on second point in object..")
if point2 = '0 0' then exit_msg()
obj = word(point1, 1)
if obj ~= word(point2, 1) then exit_msg("Points must be in same object")
if ~isbezier(obj) then exit_msg("Object must be a bezier object")
pt1 = word(point1, 2)
pt2 = word(point2, 2)
if pt2 < pt1 then
do
temp = pt2
pt2 = pt1
pt1 = temp
end
hspace = pdm_GetForm("Enter horizontal spacing..", 8, "Horizontal")
if hspace = '' then exit_msg()
vspace = pdm_GetForm("Enter Vertical spacing..", 8, "Vertical")
if vspace = '' then exit_msg()
if ~(datatype(hspace, n) & datatype(vspace, n)) then exit_msg("Invalid Entry")
fpos = pdm_GetPoint(obj, pt1)
parse var fpos hpos ' ' vpos ' ' .
if pdm_Inform(2, "Flatten tangents?", "Yes", "No") then
do cpoint = pt1 to pt2
cpos = pdm_GetPoint(obj, cpoint)
parse var cpos cpx ' ' cpy ' ' .
call pdm_MovePoint(obj, cpoint, hpos - cpx, vpos - cpy)
hpos = hpos + hspace
vpos = vpos + vspace
end
else
do cpoint = pt1 to pt2
call pdm_SetPoint(obj, cpoint, hpos" "vpos" 0 0 0 0")
hpos = hpos + hspace
vpos = vpos + vspace
end
exit_msg()
exit_msg: procedure expose units
do
parse arg message
if message ~= '' then call pdm_Inform(1,message,)
call pdm_SetUnits(units)
call pdm_AutoUpdate(1)
exit
end